#include <skyroad/detail/config.hpp>
#include <skyroad/option/options.hpp>
#include <skyroad/detail/settings.hpp>
#include <skyroad/log/logger.hpp>

const int MAX_SIZE_PER_FILE = 1024 * 1024;
const int FILE_COUNT = 5;

static int g_log_level() 
{
    //static int log_level = g_options().log_level();
    return 0;
}

static rolling_file& g_log_dbg()
{
	static rolling_file out = rolling_file(app_path() + "\\log\\debug.txt",
			rolling_file_settings()
				.initial_erase(false)
				.max_size_bytes(MAX_SIZE_PER_FILE)
				.file_count(FILE_COUNT)
				.flush_each_time(true)
				.extra_flags(std::ios::binary)
				.console_print(false)
			);	
	return out;
}

static rolling_file& g_log_inf()
{
	static rolling_file out = rolling_file(app_path() + "\\log\\info.txt",
			rolling_file_settings()
				.initial_erase(false)
				.max_size_bytes(MAX_SIZE_PER_FILE)
				.file_count(FILE_COUNT)
				.flush_each_time(true)
				.extra_flags(std::ios::binary)
				.console_print(true)
			);	
	return out;
}

static rolling_file& g_log_wrn() 
{
	static rolling_file out = rolling_file(app_path() + "\\log\\warning.txt",
			rolling_file_settings()
				.initial_erase(false)
				.max_size_bytes(MAX_SIZE_PER_FILE)
				.file_count(FILE_COUNT)
				.flush_each_time(true)
				.extra_flags(std::ios::binary)
				.console_print(true)















			);	
	return out;
}

static rolling_file& g_log_err()
{
	static rolling_file out = rolling_file(app_path() + "\\log\\error.txt",
			rolling_file_settings()
				.initial_erase(false)
				.max_size_bytes(MAX_SIZE_PER_FILE)
				.file_count(FILE_COUNT)
				.flush_each_time(true)
				.extra_flags(std::ios::binary)
				.console_print(true)
			);	
	return out;
}

static rolling_file& g_log_ftl()
{
	static rolling_file out = rolling_file(app_path() + "\\log\\fatal.txt",
			rolling_file_settings()
				.initial_erase(false)
				.max_size_bytes(MAX_SIZE_PER_FILE)
				.file_count(FILE_COUNT)
				.flush_each_time(true)
				.extra_flags(std::ios::binary)
				.console_print(true)
			);	
	return out;
}

void init_logs() 
{
	//using namespace firebird;
	//
	//g_log_level();
	//g_log_dbg();
 //   g_log_inf();
 //   g_log_wrn();
 //   g_log_err();
 //   g_log_ftl();
}

}